package NovelBar.controller;

import NovelBar.entity.Reward;
import NovelBar.service.RewardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class RewardController {
    @Autowired
    private RewardService rewardService;

    @RequestMapping("/public/insertReward")
    public String  insertReward(Reward reward) {
        return rewardService.insertReward(reward);
    }

    @RequestMapping("/public/loadRewardByWiterid")
    public List<Map> loadRewardByWiter(Integer witerid) {
        return rewardService.loadRewardByWiterid(witerid);
    }

    @RequestMapping("/public/loadRewardByUserid")
    public List<Map> loadRewardByUserid(Integer userid) {
        return rewardService.loadRewardByUserid(userid);
    }
}
